port=$(cat ./port);
echo $port;
currentTime=`date "+%Y-%m-%d-%H-%M-%S"`;
ctnId=`docker ps | grep -i $port | awk '{print $1}'`
echo -e " $ctnId"
if [ ! -n $ctnId ]; then  
  echo -e "上次启动的dockerID IS NULL"  
else
  echo -e "上次启动的dockerID IS $ctnId"
  docker stop $ctnId && docker rm $ctnId
fi
tag="dockerstudy-$currentTime";
docker build -t $tag .
docker run --name dockerstudy --link docker_mongodb:docker_mongodb -p 3000:3000 -d $tag